﻿<%@ Page Title="" Language="C#" MasterPageFile="~/movie.master" AutoEventWireup="true" CodeFile="signup.aspx.cs" Inherits="signup" %>
<%@ MasterType VirtualPath="~/movie.master" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <style type="text/css">
    .style1
    {
        width: 100%;
    }
</style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
    <div id="maincontent">
    <h3>Sign Up</h3>
    Fill the following details and start enjoying your DVD rentals. <br />
    <div class="smallfont">We will not sell or rent your email address. 
        We may contact you about the our service. See our privacy notice.</div>
        <br /><br />
    
    <table cellpadding="3px" cellspacing="3px" class="style1">
        <tr>
            <td colspan="2">Fields marked with an asterisk (<font style="color:white">*</font>) are required
            </td>
        </tr>
        <tr>
            <td>
                <font style="color:white">* </font>Email</td>
            <td>
                <asp:TextBox ID="txtEmail" MaxLength="40" runat="server" Width="173px"></asp:TextBox>
                <asp:RegularExpressionValidator runat="server" ControlToValidate="txtEmail" EnableClientScript="False" Text="Email format: myname@domain.com" ForeColor="white" ErrorMessage="Please enter a valid email address"
                                       ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*" Width="208px"  Display="Dynamic" ValidationGroup="signup" Font-Size="Small" SetFocusOnError="true"></asp:RegularExpressionValidator>
                <asp:RequiredFieldValidator runat="server" ControlToValidate="txtEmail"
                                       ErrorMessage="Email is required" Text="Required" ValidationGroup="signup"  ForeColor="white" Font-Size="Small" Width="150px" SetFocusOnError="true"></asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td>
                <font style="color:white">* </font>Password</td>
            <td>
                <asp:TextBox ID="txtPassword" MaxLength="10" runat="server" TextMode="Password" width="173px"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtPassword"
                                       ErrorMessage="Password is required" Text="Required" ValidationGroup="signup"  ForeColor="white" Font-Size="Small" Width="150px" SetFocusOnError="true"></asp:RequiredFieldValidator>
          
            </td>
        </tr>
        <tr>
            <td>
                <font style="color:white">* </font>Name</td>
            <td>
                <asp:TextBox ID="txtName" runat="server" MaxLength="30" width="173px"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtName"
                                       ErrorMessage="Name is required" Text="Required"  ValidationGroup="signup"  ForeColor="white" Font-Size="Small" Width="150px" SetFocusOnError="true"></asp:RequiredFieldValidator>
          </td>
        </tr>
        <tr>
            <td>
                <font style="color:white">* </font>Address</td>
            <td>
                <asp:TextBox ID="txtAddress" MaxLength="40" runat="server" Width="228px"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="txtAddress"
                                       ErrorMessage="Address is required" Text="Required" ValidationGroup="signup"  ForeColor="white" Font-Size="Small" Width="150px" SetFocusOnError="true"></asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td>
                <font style="color:white">* </font>City</td>
            <td>
                <asp:TextBox ID="txtCity" runat="server" MaxLength="20" width="173px"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="txtCity"
                                       ErrorMessage="City is required" Text="Required" ValidationGroup="signup"  ForeColor="white" Font-Size="Small" Width="150px" SetFocusOnError="true"></asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td>
                <font style="color:white">* </font>State</td>
            <td>
                <asp:DropDownList ID="dllState" runat="server" DataSourceID="DSState" AppendDataBoundItems="true" AutoPostBack="false" DataValueField="state_ID" DataTextField="state_long">
                    <asp:ListItem Text="Select State" Value=""></asp:ListItem>
                </asp:DropDownList>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ControlToValidate="dllState"
                                       ErrorMessage="State is required" Text="Required"  ValidationGroup="signup"  ForeColor="white" Font-Size="Small" Width="150px" SetFocusOnError="true"></asp:RequiredFieldValidator>
         
                <asp:SqlDataSource ID="DSState" runat="server" ConnectionString="<%$ ConnectionStrings:moviesConnection %>" SelectCommand="mov_getStates" SelectCommandType="StoredProcedure"></asp:SqlDataSource>
            </td>
        </tr>
        <tr>
            <td>
                <font style="color:white">* </font>Postal Code</td>
            <td>
                <asp:TextBox ID="txtZip" runat="server" MaxLength="5" width="173px"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" ControlToValidate="txtZip"
                                       ErrorMessage="Zip is required" Text="Required" ValidationGroup="signup"  ForeColor="white" Font-Size="Small" Width="150px" SetFocusOnError="true"></asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td colspan="2">
                <asp:Label ID="lblError" CssClass="Message" runat="server" Text="Email already exists, please register with a different Email ID" Visible="false"></asp:Label>
            </td>
        </tr>
        <tr>
            <td>&nbsp;</td>
            <td>
                <asp:Button ID="btnSubmit" runat="server" Text="Submit" 
                    onclick="btnSubmit_Click" />
            </td>
        </tr>
    </table>
    
</div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="RightContent" Runat="Server">
</asp:Content>

